load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("scm_server_infra")

rust_library(
    name = "edenapi_service",
    srcs = glob(["src/**/*.rs"]),
    named_deps = ({} if rust_oss.is_oss_build() else {
        "MononokeSaplingApiRequest_ods3_types": "//eden/mononoke/facebook/ods3_schemas:MononokeSaplingApiRequest_ods3-rust",
    }),
    test_deps = [
        "//common/rust/shed/fbinit:fbinit-tokio",
        "//configerator/structs/scm/mononoke/ratelimiting:rate_limiting_config-rust",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
    ],
    deps = ([
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-stream",
        "fbsource//third-party/rust:tracing",
        "fbsource//third-party/rust:async-trait",
        "//common/rust/shed/futures_ext:futures_ext",
        "fbsource//third-party/rust:base64",
        "fbsource//third-party/rust:bytes",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:gotham",
        "fbsource//third-party/rust:async-compression",
        "fbsource//third-party/rust:tracing",
        "//common/rust/shed/sorted_vector_map:sorted_vector_map",
        "fbsource//third-party/rust:rayon",
        "fbsource//third-party/rust:gotham_derive",
        "fbsource//third-party/rust:hex",
        "fbsource//third-party/rust:http",
        "fbsource//third-party/rust:smallvec",
        "fbsource//third-party/rust:hyper-0-14",
        "fbsource//third-party/rust:itertools",
        "fbsource//third-party/rust:lazy_static",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "fbsource//third-party/rust:maplit",
        "fbsource//third-party/rust:mime",
        "fbsource//third-party/rust:nonzero_ext",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:pin-project",
        "fbsource//third-party/rust:rand",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_cbor",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:sha2",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:vec1",
        "fbsource//third-party/rust:tokio-util",
        "//common/rust/shed/cloned:cloned",
        "//common/rust/shed/fbinit:fbinit",
        "//eden/mononoke/repo_attributes/commit_graph/commit_graph:commit_graph",
        "//common/rust/shed/futures_stats:futures_stats",
        "//common/rust/shed/justknobs_stub:justknobs",
        "//common/rust/shed/stats:stats",
        "//common/rust/shed/time_ext:time_ext",
        "//eden/mononoke/repo_attributes/repo_blobstore:repo_blobstore",
        "//eden/mononoke/repo_client:streaming_clone",
        "//eden/mononoke/blobstore:blobstore",
        "//eden/mononoke/blobstore:ephemeral_blobstore",
        "//eden/mononoke/repo_attributes/bookmarks:bookmarks",
        "//eden/mononoke/repo_attributes/bookmarks/bookmarks_movement:bookmarks_movement",
        "//eden/mononoke/features/commit_cloud/types:commit_cloud_types",
        "//eden/mononoke/common/scuba_ext:scuba_ext",
        "//eden/mononoke/repo_attributes/filestore:filestore",
        "//eden/mononoke/git/git_types:git_types",
        "//eden/mononoke/gotham_ext:gotham_ext",
        "//eden/mononoke/features/hooks:hooks",
        "//eden/mononoke/manifest:manifest",
        "//eden/mononoke/mercurial:mercurial_types",
        "//eden/mononoke/metaconfig:metaconfig_types",
        "//eden/mononoke/mononoke_api:mononoke_api",
        "//eden/mononoke/mononoke_api_hg:mononoke_api_hg",
        "//eden/mononoke/mononoke_configs:mononoke_configs",
        "//eden/mononoke/repo_attributes/bonsai_hg_mapping:bonsai_hg_mapping",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/permission_checker:permission_checker",
        "//eden/mononoke/rate_limiting:rate_limiting",
        "//eden/mononoke/repo_attributes/repo_identity:repo_identity",
        "//eden/mononoke/server/context:context",
        "//eden/mononoke/time_window_counter:time_window_counter",
        "//eden/scm/lib/clientinfo:clientinfo",
        "//eden/scm/lib/dag/dag-types:dag-types",
        "//eden/scm/lib/edenapi/types:edenapi_types",
        "//eden/scm/lib/revisionstore:revisionstore_types",
        "//eden/scm/lib/types:types",
    ] + ([] if rust_oss.is_oss_build() else [
        "//eden/mononoke/facebook/ods3_schemas:MononokeSaplingApiRequest_ods3-rs_bindings",
    ])),
)
